<%-- 
    Document   : shopping
    Created on : 2019-9-24, 11:10:51
    Author     : 10592
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link type="text/css" rel="stylesheet" href="css/style.css" />
    </head>
    <body>
        <div id="header" class="wrap">
            <div id="logo">网上书城</div>
            <div id="navbar">
                <div class="userMenu">
                    <ul>
                        <li><a href="index.html">User首页</a></li>
                        <li><a href="order.html">我的订单</a></li>
                        <li class="current"><a href="shopping.html?action=add">购物车</a></li>
                        <li><a href="#">注销</a></li>
                    </ul>
                </div>
                <form method="get" name="search" action="">
                    搜索：<input class="input-text" type="text" name="keywords" /><input class="input-btn" type="submit" name="submit" value="" />
                </form>
            </div>
        </div>
        <div id="content" class="wrap">
            <div class="list bookList">
                <form method="post" name="shoping" action="shopping.html?action=order">
                    <c:if test="${empty ShoppingCart}">
                        <h1>目前没有任何商品</h1>
                    </c:if>
                    <c:if test="${not empty ShoppingCart}"> 

                        <!--<a href="${contextPath}/cart?action=order">下订单</a>-->
                        <table> 
                            <tr class="title" >
                                <th class="view">图片预览</th>
                                <th>书名</th>
                                <th class="nums">数量</th>
                                <th class="price">价格</th>
                            </tr>
                        </table>
                        <table  id="shoppinglist">
                      
                            <c:forEach items="${ShoppingCart.items}" var="cartItem" varStatus="status">
                           
                                <tr>
                                    <td class="thumb"><img src="${cartItem.book.image}" /></td>
                                    <td class="title">${cartItem.book.bookName}</td>
                                    <td class="number"><input class="input-text" type="text" name="nums" value="${cartItem.number}" /></td>
                                    <td>￥<span>${cartItem.book.price}</span></td>
                                </tr>
                            </c:forEach>
                        </table>
                    </c:if>
                    <div class="button">
                        <h4>总价：￥<span >${ShoppingCart.cost}</span>元</h4>
                        <input class="input-chart" type="submit" name="submit" value="" />
                    </div>
                </form>
            </div>
        </div>
        <div id="footer" class="wrap">
            网上书城 &copy; 版权所有

        </div>
    </body>
  
</html>
